Skip to content

ast-exporter: Do not process macros for the syntactic form of InitListExpr#1826

Merged
ahomescu merged 1 commit into
immunant:masterfrom
Rua:macro-ile-fix
May 30, 2026
Merged

ast-exporter: Do not process macros for the syntactic form of InitListExpr#1826
ahomescu merged 1 commit into
immunant:masterfrom
Rua:macro-ile-fix

Conversation

@Rua

@Rua Rua commented May 25, 2026

Copy link
Copy Markdown
Contributor

In the exporter, the macroCallSites variable keeps track of which macro call sites have already been visited, so that only the outermost expression gets processed for that call site. But that depends on Clang's visiting order, and in the case of init lists, the syntactic form appears to be visited first, which then prevents macros from being associated with the semantic form. This PR skips macro processing for the syntactic form (which c2rust ignores anyway), fixing expansion for init lists in the transpiler.

@Rua Rua force-pushed the macro-ile-fix branch from 745974e to 5d4a8e9 Compare May 25, 2026 14:28

@fw-immunant fw-immunant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

@ahomescu ahomescu merged commit 8816833 into immunant:master May 30, 2026
11 checks passed
@Rua Rua deleted the macro-ile-fix branch May 30, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants